<template>
  <q-page class="cc-admin">

    <div class="col bg-white shadow-2 q-pa-md q-ma-sm">
      <q-table flat color="primary" class="cross_table" separator="cell" :columns="columns" :data="list" row-key="id" :pagination.sync="pagination" :visible-columns="group" @request="query" :rows-per-page-options="[10, 20, 50, 100]" selection="multiple" :selected.sync="selected">

        <!-- <template v-slot:top="table">
          <div class="row no-wrap full-width">
            <q-input clearable outlined dense placeholder="请输入关键字搜索" class="on-left" @input="query" debounce="500" v-model="key">
              <template #append>
                <q-btn flat round icon="search" color="primary" @click="query" :loading="loading">
                  <q-tooltip>搜索</q-tooltip>
                </q-btn>
              </template>
            </q-input>
            <q-space />
            <table-top-btns label="台风实况路径" modelName="typhoonTrack" :showAdd="true" :table="table" :selected="selected" :importing="importing" :exporting="exporting" :importExcelUrlFull="importExcelUrlFull" :columns="columns" @groupChange="groupChange" @add="add" @importExcel="importExcel" @exportExcel="exportExcel"
              @showConfirm="showConfirm" />
          </div>
        </template> -->
        <template #body-cell-opt="props">
          <q-td :props="props" :auto-width="true">
            <q-btn flat round dense color="primary" icon="edit" @click="edit(props.row)"> <q-tooltip>编辑</q-tooltip></q-btn>
            <q-btn flat round dense color="primary" icon="mdi-content-copy" @click="copy(props.row)">
              <q-tooltip>复制</q-tooltip>
            </q-btn>
            <btn-del label="台风实况路径" @confirm="del(props.row)" />
          </q-td>
        </template>
      </q-table>
    </div>
    <q-dialog maximized flat persistent ref="dialog">
      <q-form @submit="submit" class="dialog_card column">
        <h5 class="view_title justify-between q-px-md">
          {{ editType }}台风实况路径
          <q-btn dense outline round icon="clear" size="sm" v-close-popup />
        </h5>
        <q-scroll-area class="col">
          <div class="row q-col-gutter-x-md dialog_form q-pa-md">
            <!-- <div class="col-12">
              <h5> 编号：</h5>
              <q-input outlined dense v-model="form.id" type="text" />
            </div>
            <div class="col-12">
              <h5> 平台id：</h5>
              <q-input outlined dense v-model="form.platformId" type="text" />
            </div>
            <div class="col-12">
              <h5> 公司id：</h5>
              <q-input outlined dense v-model="form.tenantId" type="text" />
            </div> -->
            <div class="col-12">
              <h5> 台风编号：</h5>
              <q-input outlined dense v-model="form.code" type="text" />
            </div>
            <div class="col-12">
              <h5> 七级风圈-东南：</h5>
              <q-input outlined dense v-model="form.r7Se" type="text" />
            </div>
            <div class="col-12">
              <h5> 预测列表：</h5>
              <q-input outlined dense v-model="form.forecastList" type="text" />
            </div>
            <div class="col-12">
              <h5> 轨迹时间：</h5>
              <q-input outlined dense v-model="form.bizDate" type="text" />
            </div>
            <div class="col-12">
              <h5> 十级风圈西南：</h5>
              <q-input outlined dense v-model="form.r10Sw" type="text" />
            </div>
            <div class="col-12">
              <h5> 十二级风圈-西南：</h5>
              <q-input outlined dense v-model="form.r12Sw" type="text" />
            </div>
            <div class="col-12">
              <h5> 中心点风速：</h5>
              <q-input outlined dense v-model="form.centerSpeed" type="text" />
            </div>
            <div class="col-12">
              <h5> 中心点气压：</h5>
              <q-input outlined dense v-model="form.centerPressure" type="text" />
            </div>
            <div class="col-12">
              <h5> 十级风圈半径：</h5>
              <q-input outlined dense v-model="form.radius10" type="text" />
            </div>
            <div class="col-12">
              <h5> 十二级风圈半径：</h5>
              <q-input outlined dense v-model="form.radius12" type="text" />
            </div>
            <div class="col-12">
              <h5> 十二集风圈-东南：</h5>
              <q-input outlined dense v-model="form.r12Se" type="text" />
            </div>
            <div class="col-12">
              <h5> 七级风圈半径：</h5>
              <q-input outlined dense v-model="form.radius7" type="text" />
            </div>
            <div class="col-12">
              <h5> 七级风圈-西北：</h5>
              <q-input outlined dense v-model="form.r7Nw" type="text" />
            </div>
            <div class="col-12">
              <h5> 纬度：</h5>
              <q-input outlined dense v-model="form.lat" type="text" />
            </div>
            <div class="col-12">
              <h5> 经度：</h5>
              <q-input outlined dense v-model="form.lon" type="text" />
            </div>
            <div class="col-12">
              <h5> 十级风圈-东南：</h5>
              <q-input outlined dense v-model="form.r10Se" type="text" />
            </div>
            <div class="col-12">
              <h5> 十二级风圈-西北：</h5>
              <q-input outlined dense v-model="form.r12Nw" type="text" />
            </div>
            <div class="col-12">
              <h5> 十级风圈-西北：</h5>
              <q-input outlined dense v-model="form.r10Nw" type="text" />
            </div>
            <div class="col-12">
              <h5> 移动方向：</h5>
              <q-input outlined dense v-model="form.moveDirection" type="text" />
            </div>
            <div class="col-12">
              <h5> 七级风圈东北：</h5>
              <q-input outlined dense v-model="form.r7Ne" type="text" />
            </div>
            <div class="col-12">
              <h5> 移动速度：</h5>
              <q-input outlined dense v-model="form.moveSpeed" type="text" />
            </div>
            <div class="col-12">
              <h5> 十级风圈东北：</h5>
              <q-input outlined dense v-model="form.r10Ne" type="text" />
            </div>
            <div class="col-12">
              <h5> 十二集风圈-东北：</h5>
              <q-input outlined dense v-model="form.r12Ne" type="text" />
            </div>
            <div class="col-12">
              <h5> 更新时间：</h5>
              <q-input outlined dense v-model="form.updatetime" type="text" />
            </div>
            <div class="col-12">
              <h5> 七级风圈-西南：</h5>
              <q-input outlined dense v-model="form.r7Sw" type="text" />
            </div>
          </div>
        </q-scroll-area>
        <div class="row justify-center q-pa-md">
          <q-btn outline color="primary" icon="mdi-close-thick" label="关闭" v-close-popup />
          <q-btn class="q-mx-md" color="primary" icon="mdi-check-bold" label="提交" :loading="loading" type="submit" />
        </div>
      </q-form>
    </q-dialog>
    <confirm ref="confirmDialog" :msg="confirmMsg" @confirm="deleteBatch()" />
    <q-inner-loading :showing="loading">
      <q-spinner-gears size="50px" color="primary" />
    </q-inner-loading>
  </q-page>
</template>

<script>
import { IndexMixin } from 'boot/mixins';
import { getDictLabel } from 'boot/dictionary';
import confirm from 'components/confirm';

export default {
  name: 'WeaTyphoonTrack',
  mixins: [IndexMixin],
  components: {
    confirm,
  },
  data() {
    return {
      columns: [
        {
          name: 'index',
          align: 'center',
          label: '序号',
          field: 'index',
        },
        // {
        //   name: 'id', align: 'left', label: '编号', field: 'id',
        // },
        // {
        //   name: 'platformId', align: 'left', label: '平台id', field: 'platformId',
        // },
        // {
        //   name: 'tenantId', align: 'left', label: '公司id', field: 'tenantId',
        // },
        {
          name: 'code', align: 'left', label: '台风编号', field: 'code',
        },
        {
          name: 'r7Se', align: 'left', label: '七级风圈-东南', field: 'r7Se',
        },
        // {
        //   name: 'forecastList', align: 'left', label: '预测列表', field: 'forecastList',
        // },
        {
          name: 'bizDate', align: 'left', label: '轨迹时间', field: 'bizDate',
        },
        {
          name: 'r10Sw', align: 'left', label: '十级风圈西南', field: 'r10Sw',
        },
        {
          name: 'r12Sw', align: 'left', label: '十二级风圈-西南', field: 'r12Sw',
        },
        {
          name: 'centerSpeed', align: 'left', label: '中心点风速', field: 'centerSpeed',
        },
        {
          name: 'centerPressure', align: 'left', label: '中心点气压', field: 'centerPressure',
        },
        {
          name: 'radius10', align: 'left', label: '十级风圈半径', field: 'radius10',
        },
        {
          name: 'radius12', align: 'left', label: '十二级风圈半径', field: 'radius12',
        },
        {
          name: 'r12Se', align: 'left', label: '十二集风圈-东南', field: 'r12Se',
        },
        {
          name: 'radius7', align: 'left', label: '七级风圈半径', field: 'radius7',
        },
        {
          name: 'r7Nw', align: 'left', label: '七级风圈-西北', field: 'r7Nw',
        },
        {
          name: 'lat', align: 'left', label: '纬度', field: 'lat',
        },
        {
          name: 'lon', align: 'left', label: '经度', field: 'lon',
        },
        {
          name: 'r10Se', align: 'left', label: '十级风圈-东南', field: 'r10Se',
        },
        {
          name: 'r12Nw', align: 'left', label: '十二级风圈-西北', field: 'r12Nw',
        },
        {
          name: 'r10Nw', align: 'left', label: '十级风圈-西北', field: 'r10Nw',
        },
        {
          name: 'moveDirection', align: 'left', label: '移动方向', field: 'moveDirection',
        },
        {
          name: 'r7Ne', align: 'left', label: '七级风圈东北', field: 'r7Ne',
        },
        {
          name: 'moveSpeed', align: 'left', label: '移动速度', field: 'moveSpeed',
        },
        {
          name: 'r10Ne', align: 'left', label: '十级风圈东北', field: 'r10Ne',
        },
        {
          name: 'r12Ne', align: 'left', label: '十二集风圈-东北', field: 'r12Ne',
        },
        {
          name: 'updatetime', align: 'left', label: '更新时间', field: 'updatetime',
        },
        {
          name: 'r7Sw', align: 'left', label: '七级风圈-西南', field: 'r7Sw',
        },
        // {
        //   name: 'opt', align: 'center', label: '操作', field: 'id',
        // },
      ],
      showQuery: true,
      headers: [{ name: 'Authorization', value: localStorage.Authorization }],
      uploadUrl: `${process.env.SERVER_URL}${process.env.BASE_URL}/sys/common/upload`,
      imgUrl: `${process.env.SERVER_URL}${process.env.BASE_URL}/sys/common/static`,
      url: {
        list: '/wea/typhoonTrack/list',
        add: '/wea/typhoonTrack/add',
        edit: '/wea/typhoonTrack/edit',
        copy:
          '/wea/typhoonTrack/copy',
        delete: '/wea/typhoonTrack/delete',
        deleteBatch: '/wea/typhoonTrack/deleteBatch',
        exportXlsUrl: '/wea/typhoonTrack/exportXls',
        importExcelUrl: '/wea/typhoonTrack/importExcel',
      },
    };
  },
  methods: {
    getDictLabel,
    initDict() {
    },
  },
  mounted() {
    this.initDict();
  },
};
</script>

<style lang="stylus">

</style>
